package com.mengmablog.blog.dao;

import com.mengmablog.blog.entity.Articles;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface ArticlesMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(Articles record);

    int insertSelective(Articles record);

    Articles selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(Articles record);

    int updateByPrimaryKeyWithBLOBs(Articles record);

    int updateByPrimaryKey(Articles record);

    List<Articles> findAllArticle();

    void updateByHitsArticleId(Integer articleId);

    List<Articles> findByNameAndType(@Param("name") String name, @Param("type") String type);

    List<Articles> findAllByYear(@Param("begin") String begin, @Param("end") String end);

    int updateById(@Param("id") Integer id, @Param("title") String title, @Param("content") String content, @Param("tags") String tags, @Param("category") String category, @Param("status") String status, @Param("allowComment") Boolean allowComment);


    int updateByTag(@Param("string1") String string1, @Param("id") Integer id);

    List<Articles> findByType();

    int updateByPage(@Param("id") Integer id, @Param("title") String title, @Param("content") String content, @Param("status") String status);

    int insertByPage( @Param("title") String title, @Param("content") String content, @Param("status") String status);

}